library(RpgSQL)
db <- dbConnect( pgSQL( classPath='/usr/local/pgsql/share/java/jdbc4.jar' ), user='jiro', dbname='MarketDatabase' )
sql = "select exchange_date as date, ( adjusted_end_price * volume ) as value from stock_exchange_ja_table where code = '1628' and exchange_date between '1990-1-1' and '2010-10-1' order by exchange_date;;"
res <- dbGetQuery( db, sql )
sql2 = "select exchange_date as date, adjusted_end_price as value from stock_exchange_ja_table where code = '1628' and exchange_date between '1990-1-1' and '2010-10-1' order by exchange_date;"
res2 <- dbGetQuery( db, sql2 )
dbDisconnect( db )
png('valume.png', width = 1440, height = 480, pointsize = 12, bg = 'white' )
plot( res$date, res$value, col='red', type='l' );
dev.off()
png('end_price.png', width = 1440, height = 480, pointsize = 12, bg = 'white' )
plot( res2$date, res2$value, col='blue', type='l' );
dev.off()
